package service.line;

import java.util.ArrayList;
import java.util.List;

import util.returnvo.LineReturnVO;
import vo.LineVO;
import dao.line.LineDAO;
import dao.subline.SublineDAO;

public class LineServiceImpl implements LineService{

	private LineDAO lineDAO;
	private SublineDAO sublineDAO;

	public void setLineDAO(LineDAO lineDAO) {
		this.lineDAO = lineDAO;
	}

	public void setSublineDAO(SublineDAO sublineDAO) {
		this.sublineDAO = sublineDAO;
	}

	@Override
	public List<LineReturnVO> getLineList() throws Exception {
		List<LineReturnVO> lrvList=new ArrayList<LineReturnVO>();
		
		List<LineVO> list=lineDAO.getAllLine();

		for(LineVO lvo:list){
			lrvList.add(new LineReturnVO(lvo, sublineDAO.getSubline(lvo.getLine_no())));
		}
		return lrvList;
	}
}
